package com.xmg.mgrsite.base;

import com.xmg.p2p.base.query.UserFileQueryObject;
import com.xmg.p2p.base.service.IUserFileService;
import com.xmg.p2p.base.util.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * lcd  2020/5/21
 * Description:
 */
@Controller
public class UserFileController {
    @Autowired
    private IUserFileService userFileService;

    @RequestMapping("userFileAuth")
    public String userFileAuth(Model model, @ModelAttribute("qo") UserFileQueryObject qo) {
        model.addAttribute("pageResult",userFileService.queryForPage(qo));
        return "userFileAuth/list";
    }

    @RequestMapping("userFile_audit")
    @ResponseBody
    public JSONResult userFileAudit(long id,int state,int score, String remark){
        userFileService.audit(id,state,score,remark);
        return new JSONResult();
    }
}
